package inabit.expressioncompiler.productions;

import inabit.compiler.parser.grammar.NonTerminal;
import inabit.compiler.parser.grammar.Production;
import inabit.compiler.parser.grammar.Symbol;
import inabit.expressioncompiler.parser.ExpressionSemanticAction;

/**U -> AA'*/
/**@author Rafael Rocha*/
public class U_Rule extends Production{
	private NonTerminal A;
	private NonTerminal A1;
	public U_Rule() {
		super("U");
	}
	@Override
	protected Symbol[] production(final NonTerminal nonTerminal) {
		A = new NonTerminal("A");
		A1 = new NonTerminal("A'");
		
		Symbol[] symbols = {
			A,
			A1,
			new ExpressionSemanticAction(nonTerminal) {
				public void execute() {
					nonTerminal.code = A.code + A1.code;
				}
			}
		};
		return symbols;
	}

}
